{{tag>programmation}}

----

{{ python.png?130nolink| Logo Python}}
====== Langage de programmation Python ======

[[wpfr>Python_(langage)|Python]] est un langage de programmation interprété, orienté objet, dont l'utilisation va des scripts systèmes aux applications web.
Il est placé sous une licence libre proche de la licence BSD et fonctionne sur la plupart des plateformes.

===== Programmer en Python =====

Pour plus d'information sur la programmation en Python, référez-vous au portail [[:programmation#python|Programmation]].
Par défaut, Python est installé sur %%GNU/Linux%%. Sous Ubuntu par exemple, saisir "python" dans un [[:terminal]] pour avoir accès à l'invite de commande Python. Pour connaître votre version de Python installé, tapez "python -V" dans le [[:terminal]]. 

==== Logiciel éditeur Python (IDE)  ====

Les logiciels pour éditer des scripts python :
 
^Nom^Cross Platform^Commercial ou Free^Auto Code Completion^Multi-Language Support^Integrated Python Debugging^Error Markup^Source Control Integration^Smart Indent^Bracket Matching^Line Numbering^UML Editing or Viewing^Code Folding^Code Templates ^Unit Testing^GUI Designer^Integrated DB Support ^ Rapid Application Development^
^Nom^CP^C/F^AC^MLS^PD^EM^SC^SI^BM^LN^UML^CF^CT^UT^UID^DB^RAD^comments^
|BlackAdder |**Y** | C | | | | | |Y | | | |Y | | | | | | |
|[[bluefish|BlueFish]] |**L** | | | | | | | | | | | | | | | | |
|Boa Constructor|**Y** | F |Y | |Y |Y | |Y |Y |Y | Y |Y |Y | | | | |
| ConTEXT |W | C | | | | | | | | | | | | | | | |
|DABO |**Y** | | | | | | | | | | | | | | | | |
| DreamPie | | F | | | | | | | | | | | | | | | |
|Dr.Python | | F | | | |Y | | | | | | | | | | | | |
|Editra |**Y** | F |Y | Y | | |Y |Y |Y |Y | |Y | | | | | |
|[[emacs|Emacs]] |**Y** | F |Y | Y |Y |Y |Y |Y |Y |Y | Y |Y |Y |Y | | | |
|[[eric|Eric Ide]] |**Y** | F |Y | Y |Y |Y |Y |Y |Y |Y |Y |Y |Y |Y |Y¹ |Y² | |¹QtDesigner ²Navigateur SQL intégré|
|E-Texteditor |W | | | | | | | | | | | | | | | | |
|[[geany|Geany]] |**Y** | F |Y*| Y | | | |Y |Y |Y | |Y | | | | | |* very limited|
|[[gedit|Gedit]] |**Y** | F |Y¹| Y | | | |Y |Y |Y | | |Y²| | | | |¹ with plugin ² sort of|
| [[idle|Idle]]           |**Y** | F |Y |   |  |  |  |  |  |  |   |  |  |  |   |  |   |
| [[jedit|JEdit]]          |**Y** | F |  | Y |  |  |  |  |Y |Y |   |Y |  |  |   |  |   |
| [[kdevelop|KDevelop]]       |**Y** | F |  | Y |  |  |Y |Y |Y |Y |   |Y |  |  |   |  |   |
^Nom^CP^C/F^AC^MLS^PD^EM^SC^SI^BM^LN^UML^CF^CT^UT^UID^DB^RAD^comments^
| [[komodo_edit|Komodo]]         |**Y** |C/F|Y | Y |Y |Y |Y |Y |Y |Y |   |Y |Y |Y |   |Y |   |
| [[netbeans|NetBeans]]       |**Y** | F |Y | Y |Y |  |Y |Y |Y |Y | Y |Y |Y |Y |   |  | Y |
| NotePad++      |W | F |  | Y |  |  |  |  |  |Y |   |  |  |  |   |  |   |
| Pfaide         |W | C |Y | Y |  |  |  |Y |Y |Y |   |Y |Y |  |   |  |   |
| PIDA           |**L**W| F |Y | Y |  |  |  |Y |Y |Y |   |Y |  |  |   |  |   |VIM based
| PTVS           |W | F |Y | Y |Y |Y |Y |Y |Y |Y |   |Y |  |  |Y* |  | Y |*WPF bsed
| PyCharm        |**Y** | C |Y | Y*|Y |  |Y |Y |Y |Y |   |Y |  |Y |   |  |   |* javascript
| PyDev([[eclipse|Eclipse]]) |**Y** | F |Y | Y |Y |Y |Y |Y |Y |Y | Y |Y |Y |Y |   |  |   |
| Pyscripter     |W | F |Y |   |Y |Y |  |Y |  |Y |   |  |Y |Y |   |  |   |
| PythonWin      |W | F |Y |   |Y |  |  |Y |Y |  |   |Y |  |  |   |  |   |
| [[scite|SciTE]]          |**Y** | F |  | Y |  |Y |  |  |Y |Y |   |Y |Y |  |   |  |   |
| ScriptDev      |W | C |Y | Y |Y |Y |  |Y |Y |Y |   |Y |Y |  |   |  |   |
| SPE            |  | F |Y |   |  |  |  |  |  |  | Y |  |  |  |   |  |   |
| [[spyder|Spyder/spyderlib]]         |**Y** | F |Y |   |Y |Y |  |Y |Y |Y |   |  |  |  |   |  |   |
| [[sublime-text|Sublime Text]]   |**Y** | C |Y | Y |  |  |  |Y |Y |Y |   |  |Y |  |   |  |   |extensible w/python
| TextMate       |M |   |  | Y |  |  |  |Y |Y |Y |   |Y |Y |  |   |  |   |
| UliPad         |**Y** | F |Y | Y |Y |  |  |Y |Y |  |   |  |Y |Y |   |  |   |
| [[vim|Vim]]            |**Y** | F |Y | Y |Y |Y |Y |Y |Y |Y |   |Y |Y |Y |   |  |   |
| WingIde        |**Y** | C |Y | Y*|Y |Y |Y |Y |Y |Y |   |Y |Y |Y |   |  |   |* support for C
| Zeus           |W | C |  |   |  |  |Y |Y |Y |Y |   |Y |Y |  |   |  |   |
^Nom^CP^C/F^AC^MLS^PD^EM^SC^SI^BM^LN^UML^CF^CT^UT^UID^DB^RAD^comments^

Acronymes:
  *     CP - Cross Platform
  *     C - Commercial
  *     F - Free
  *     AC - Automatic Code-completion
  *     MLS - Multi-Language Support
  *     PD - Integrated Python Debugging
  *     EM - ErrorMarkup
  *     SC - Source Control integration
  *     SI - Smart Indent
  *     BM - Bracket Matching
  *     LN - Line Numbering
  *     UML - UML editing / viewing
  *     CF - Code Folding
  *     CT - Code Templates
  *     UT - Unit Testing
  *     UID - GUI Designer (for example, Qt, Eric, ..)
  *     DB - integrated database support
  *     RAD - Rapid application development support
  *     L - Linux
  *     W - Windows
  *     M - Mac
==== Logiciels de création d'interface graphique ====
Les logiciels pour créer des interfaces graphiques pour python:
  * QT Creator pour des interfaces en QT


===== Installation =====
==== Python 2 ====
Python 2 est installé par défaut, il suffit de taper ''python'' dans un terminal pour accéder à l'interpréteur.

==== Python 3 et Ubuntu ====
=== Ubuntu 16.04 (et 14.04) ===

La dernière version (3.6) n'est pas dans les dépots de la dernière LTS 16.04 (ni de la précédente 14.04) . La version 3.6 apporte des différences significatives par rapport à la version précédente (entre autres avec les F String) et peut être nécessaire.

Pour installer Python 3.6 avec Ubuntu 16.04, il faut ajouter un ppa :
  * soit  ''jonathonf/python-3.6''
  * soit ''deadsnakes/ppa''

Puis on installe Python 3.6.

Les commandes complètes avec, par exemple, //jonathon// ppa :

<code>
$ sudo add-apt-repository ppa:jonathonf/python-3.6
$ sudo apt update
$ sudo apt install python3.6 
</code>

Pour invoquer l'interpréteur, il faut taper ''python3'' ou ''python3.6'' !

=== Ubuntu  16.10, 17.04, 17.10===
Pour //Ubuntu 16.10// et //17.04//, //Python 3.6// est packagé dans le dépôt universe, donc s'il est actif, il suffit de taper :
<code>
$ sudo apt install python3.6 
</code>

U//buntu 17.10// est livré avec //Python 3.6//, il suffit de taper ''python3'' pour l'invoquer.

==== IDLE 3.6 ====
Pour installer IDLE en version //Python 3.6// (si on a déjà installé Python en 3.6), il suffit d'installer ''idle-python3.6''.

==== iPython ====

Voici les instructions pour installer iPython (dans une version récente) sous 16.04, avec ''pip'' : \\
(la première ligne installe pip3)
<code>
$ sudo apt install python3-pip
$ pip3 install --upgrade pip
$ sudo pip3 install jupyter
$ sudo pip3 install ipython
</code>
===== Logiciels liés à Python =====

Voici la liste des pages de la documentation présentant les logiciels liés au langage Python :

{{backlinks>.}}
  * [[wpfr>SageMath|SageMath (CAS)]]
===== Voir aussi =====

  * [[wpfr>Python_(langage)|Python  sur wikipedia]] [fr]
  * [[http://www.afpy.org/|Association francophone Python]] [fr]
  * [[http://wikipython.flibuste.net/|Wiki Python francophone]] [fr]
  * [[http://www.python.org/|Site officiel]] [en]
  * [[http://www.howopensource.com/2011/05/how-to-install-and-manage-different-versions-of-python-in-linux/|How to install and manage different versions of Python in Linux]] [en]
  * [[http://python.lycee.free.fr/|Débuter avec Python au lycée]] [fr]
  * [[https://www.fun-mooc.fr/courses/inria/41001S03/session03/about | MOOC python Inria sur France Universités Numériques]] [fr]
  * [[http://fr.openclassrooms.com/informatique/cours/apprenez-a-programmer-en-python]] [fr]
  * [[http://www.jchr.be/python/manuel.htm]] [fr]
  * [[http://www.swaroopch.com/notes/python/]] [en]
  * [[http://www.esi.umontreal.ca/~mousseau/phy1234/notes/notes_1.html]] [fr]
  * [[http://ipython.org/]]
---------

//[[:utilisateurs:draco31.fr|draco31.fr]] Le 25/06/2010, 22:23//